<!-- 任务领取列表 -->
<template>
	<view class="page">
		<cu-custom bgColor="bg-white" :isBack="true" :isrefresh="true">
			<block style="color: #777777;font-size: 32rpx;" slot="content">消息详情</block>
		</cu-custom>
		<view class="content" style="background-color: #fff;">
			<ul>
				<li>
					<text class="list-info">通知名称：</text>
					<text class="list-title">{{noticeInfo.noticeName || ''}}</text>
				</li>
				<li>
					<text class="list-info">反馈状态：</text>
					<text class="list-title">{{noticeInfo.feedbackStatus | noticeFeedback}}</text>
				</li>
				<li>
					<view class="list-box" style="padding: 0;font-size: 12px;align-items: center;">
					<p class="list-info" style="line-height: 94rpx;">通知内容：</p>
					<p class="list-title" style="flex:1;">{{noticeInfo.noticeContent || ''}}</p>
				</view>
				</li>
				<li>
					<text class="list-info">发布时间：</text>
					<text class="list-title">{{noticeInfo.addTime || ''}}</text>
				</li>
				<li>
					<text class="list-info">读取时间：</text>
					<text class="list-title">{{noticeInfo.readTime || ''}}</text>
				</li>
			</ul>
		</view>
		<view class="list-item">
			<button v-if="noticeInfo.feedbackStatus==0" @click="tofeedBack" type="primary" shape="square">反馈</button>
		</view>
		<message />
	</view>
</template>

<script>
	export default {
		onLoad(option) {
			this.taskId = option.ucId
		},
		data() {
			return {
				noticeInfo: {
					noticeName: '',
					feedbackStatus: '',
					noticeContent: '',
					addTime: '',
					readTime: ''
				},
				taskId: ''
			}
		},
		onShow(){
			this.initView(this.taskId)
		},
		methods: {
			initView(val) {
				this.noticeInfo = {}
				this.getNoticeInfo(val)
			},
			tofeedBack() {
				uni.navigateTo({
					url: '/pages/notice/feedback?ucId=' + this.taskId
				})
			},
			getNoticeInfo(val) {
				let that = this
				let app = getApp()
				app.globalData.request({
					url: 'wx/notice/getInNoticeVo',
					data: {ucId: val}
				}).then(function(res) {
					console.info(res.data)
					that.noticeInfo = res.data.data
				}).catch(function(e) {
				
				})
			}
		}
	}
</script>

<style>
	page {
		width: 100vw;
	}
	
	.content {
		margin-top: 24rpx;
		background-color: #FFFFFF;
	}
	
	ul li {
		list-style: none;
		margin: 0;
		padding: 0;
		margin-left: 24rpx;
		position: relative;
	}
	
	li text {
		font-size: 24rpx;
	}
	
	li::after {
		content: '';
		position: absolute;
		left: 2rpx;
		bottom: 0;
		right: 2rpx;
		height: 1px;
		background-color: #dcdcdc;
	}
</style>
